/**
 * Created by zqk on 2018/4/16.
 */
$(document).ready(function () {

    var form = new xhForm($('#xh_form'));
    form.parse();
    form.bindRequired($('#bt_modal_confirm',parent.document));
    //表单提交
    $('#bt_modal_confirm',parent.document).click(function () {
        // window.top.xhTop.getActiveFrame().obj.boxList.reload();
        // window.top.xhTop.closeModal();
        $.ajax({
            url:'saveBox',
            data:$('#xh_form').serialize(),
            type:'POST',
            success:function (data) {
                // window.top.xhTop.showSuccess(
                //     data.msg,
                // );
                window.top.xhTop.getActiveFrame().obj.boxList.reload();
                window.top.xhTop.closeModal();
            },
            error:function (data) {
                xhExtra.setBtnNormal($('#bt_modal_confirm',parent.document));
                $('#bt_modal_confirm',parent.document).removeClass('disabled');
                window.top.xhTop.showError(
                    data.responseJSON.error,
                    data.responseJSON.msg,
                    'error'
                );
            }
        });
    });

    

});